<template>
  <div class="search">
    <f-form ref="form" :action="api.bsd" :form-key="this.formItem.financeId">
      <f-form-item label="原单号" name="orderNo" :value="formItem.orderNo"/>
      <f-form-item label="发货金额差异" name="saleAmount" :value="formItem.saleAmount"/>
      <f-form-item label="应返金额差异" name="supplierRetable" :value="formItem.supplierRetable"/>
      <f-form-item label="实返金额差异" name="supplierRealAmount" :value="formItem.supplierRealAmount"/>
      <f-form-item label="备注" name="remark" :value="formItem.remark"/>
    </f-form>
  </div>
</template>
<script>
import api from './js/api'

export default {
  name: 'sfinanceForm',
  props: {},
  data() {
    return {
      refs: this.$refs,
      api: Object.assign(api, this.api),
      isAdd: true,//是否是添加模式
      loaded: false,//是否加载完成
      formItem: this.getFormItem()
    }
  },
  methods: {
    getFormItem() {
      return {
        sfinanceId: '',
        saleAmount: '',
        remark: ''
      }
    },
    //表单赋值
    setData(data) {
      this.$refs.form.resetFields()
      this.formItem = this.getFormItem()
      if (data && data.sfinanceId) {
        let params = {
          sfinanceId: data.sfinanceId
        }
        this.formItem.sfinanceId=data.sfinanceId;
        this.isAdd = false
      } else {
        this.loaded = true
      }
    },
    //提交表单
    handleSubmit(callback) {
      this.$refs.form.submit({ sfinanceId: this.formItem.sfinanceId}, callback)
    }
  },
  created() {
  },
  components: {}
}
</script>

<style scoped lang="less" rel="stylesheet/less">

</style>
